{% extends 'home/layout1.html' %}
{% import 'common/index_page.html' as pg %}
{% block content %}
<section id="hotmovie" style="margin-top:76px">
    <div class="container">
        <div class="row wow fadeInRight" data-wow-delay="0.6s">
            <div class="row">
                <iframe class="wow fadeIn" width="100%" height="375px" frameborder=0 scrolling=no src="{{url_for('home.animation')}}"></iframe>
            </div>
        </div>
    </div>
</section>
<!--热门电影-->
<!--电影列表-->
<section id="movielist">
    <div class="container">
        <div class="row wow fadeIn" data-wow-delay="0.6s">
            <div class="col-md-12 table-responsive">
                <table class="table text-left table-bordered" id="movietags">
                    <tr>
                        <td style="width:10%;">电影标签</td>

                        <td style="width:90%;">
                            {% for tag in tags %}
                            <a href="{{ url_for('home.index',page=1) }}?tid={{tag.id}}&star={{ condition.star }}&time={{ condition.time }}&pm={{ condition.pm }}&cm={{ condition.cm }}" class="label label-info"><span class="glyphicon glyphicon-tag"></span>&nbsp;{{ tag.name }}</a>&nbsp;
                            {% endfor %}



                    </tr>
                    <tr>
                        <td>电影星级</td>
                        <td>
                            {% for star in range(1,6) %}
                            <a href="{{ url_for('home.index',page=1) }}?tid={{condition.tid}}&star={{ star }}&time={{ condition.time }}&pm={{ condition.pm }}&cm={{ condition.cm }}" class="label label-warning"><span class="glyphicon glyphicon-star"></span>&nbsp;{{ star }}星</a>
                            {% endfor %}
                        </td>
                    </tr>
                    <tr>
                        <td>上映时间</td>
                        <td>
                            <a href="{{ url_for('home.index',page=1) }}?tid={{condition.tid}}&star={{ condition.star }}&time={{ 0 }}&pm={{ condition.pm }}&cm={{ condition.cm }}" class="label label-default"><span class="glyphicon glyphicon-time"></span>&nbsp;最近</span></a>`&nbsp;
                            <a href="{{ url_for('home.index',page=1) }}?tid={{condition.tid}}&star={{ condition.star }}&time={{ 1 }}&pm={{ condition.pm }}&cm={{ condition.cm }}" class="label label-default"><span class="glyphicon glyphicon-time"></span>&nbsp;更早</span></a>
                        </td>
                    </tr>
                    <tr>
                        <td>播放数量</td>
                        <td>
                            <a href="{{ url_for('home.index',page=1) }}?tid={{condition.tid}}&star={{ condition.star }}&time={{ condition.time }}&pm={{ 0 }}&cm={{ condition.cm }}" class="label label-success"><span class="glyphicon glyphicon-arrow-down"></span>&nbsp;从高到底</span></a>
                            &nbsp;
                            <a href="{{ url_for('home.index',page=1) }}?tid={{condition.tid}}&star={{ condition.star }}&time={{ condition.time }}&pm={{ 1 }}&cm={{ condition.cm }}" class="label label-danger"><span class="glyphicon glyphicon-arrow-up"></span>&nbsp;从低到高</span></a>
                        </td>
                    </tr>
                    <tr>
                        <td>评论数量</td>
                        <td>
                            <a href="{{ url_for('home.index',page=1) }}?tid={{condition.tid}}&star={{ condition.star }}&time={{ condition.time }}&pm={{ condition.pm }}&cm={{ 0 }}" class="label label-success"><span class="glyphicon glyphicon-arrow-down"></span>&nbsp;从高到底</span></a>
                            &nbsp;
                            <a href="{{ url_for('home.index',page=1) }}?tid={{condition.tid}}&star={{ condition.star }}&time={{ condition.time }}&pm={{ condition.pm }}&cm={{ 1 }}" class="label label-danger"><span class="glyphicon glyphicon-arrow-up"></span>&nbsp;从低到高</span></a>
                        </td>
                    </tr>
                </table>
            </div>
            {% for movie in movies.items %}
            <div class="col-md-3">
                <div class="movielist text-center">
                    <!--<img data-original="holder.js/262x166"
                             class="img-responsive lazy center-block" alt="">-->
                    <img src="{{ url_for('static',filename=movie.logo) }}" class="img-responsive center-block" width="262px" alt="">
                    <div class="text-left" style="margin-left:auto;margin-right:auto;width:210px;">
                        <span style="color:#999;font-style: italic;">{{ movie.title }}</span><br>
                        <div>
                            {% for num in  range(1,movie.star+1) %}
                            <span class="glyphicon glyphicon-star" style="color:#FFD119"></span>
                            {% endfor %}
                              {% for num in  range(1,5-movie.star+1) %}
                            <span class="glyphicon glyphicon-star-empty" style="color:#FFD119"></span>
                                  {% endfor %}
                        </div>
                    </div>
                    <a href="{{url_for('home.video',id=movie.id,page=1)}}" class="btn btn-primary" target="_blank" role="button"><span class="glyphicon glyphicon-play"></span>&nbsp;播放</a>
                </div>
            </div>
            {% endfor %}
             <div class="col-md-12 text-center" style="margin-top:6px;">
                {{ pg.render_pagination(movies,'home.index',condition) }}
            </div>
        </div>
    </div>
</section>
{% endblock %}